{{ $_hugo_config := `{ "version": 1 }` }}
{{ $blockID := printf "td-cover-block-%d" .Ordinal }}
{{ $logo_image := resources.Get "images/lp-logo.png" }}
{{ $col_id := .Get "color" | default "primary" }}
{{ $image_anchor := .Get "image_anchor" | default "smart" }}
{{ $logo_anchor := .Get "logo_anchor" | default "smart" }}
{{/* Height can be one of: auto, min, med, max, full. */}}
{{ $height := .Get "height" | default "med" }}
{{ $byline := .Get "byline" | default "" }}
<section id="{{ $blockID }}" class="row td-cover-block td-cover-block--height-{{ $height }} -bg-{{ $col_id }}">
  <div class="container td-overlay__inner">
    <div class="row">
      <div class="col-12">
        <div class="text-center lp-cover-container">
          <div class="display-1 mt-0 mt-md-5 pb-4">
            {{ with $logo_image }}
            {{ $logo_image_resized := (.Fit (printf "320x159 %s" $logo_anchor)) }}
            {{ $logo_image_resized_1_5x := (.Fit (printf "480x238 %s" $logo_anchor)) }}
            {{ $logo_image_resized_2x := (.Fit (printf "640x318 %s" $logo_anchor)) }}
              <img
                class="td-cover-logo"
                src="{{ $logo_image_resized.RelPermalink }}"
                width="320"
                height="159"
                srcset="{{ $logo_image_resized.RelPermalink }},
                        {{ $logo_image_resized_1_5x.RelPermalink }} 1.5x,
                        {{ $logo_image_resized_2x.RelPermalink }} 2x"
                alt="PipeCD Logo" >
            {{ end }}
          </div>
          {{ with .Get "subtitle" }}<p class="display-2 text-uppercase mb-0">{{ . | html }}</p>{{ end }}
          <div class="lead">
            {{ .Inner | markdownify}}
          </div>
        </div>
      </div>
    </div>
  </div>
  {{ if $byline }}
  <div class="byline">
    <small>{{ $byline }}</small>
  </div>
  {{ end }}
</section>
